package com.baox.agridata.synchronous.controller;

import com.baox.agridata.synchronous.entity.TUSERAHIAgency;
import com.baox.agridata.synchronous.entity.UserDataToSiChuanResponse;
import com.baox.agridata.synchronous.result.Result;
import com.baox.agridata.synchronous.service.AgencyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 接收成都发往四川数据的Controller(接收机构数据的)
 */
@RestController
@Slf4j
@RequestMapping("/receive")
public class ReceiveChengDuAgencyDataController {

    @Autowired
    private AgencyService agencyService;
    /**
     * 接收成都机构数据
     * @param l_list
     */
    @RequestMapping(value = "/ChengduTUSERAHIAgency", method = RequestMethod.POST)
    public Result receiveTUSERAHIAgency(@RequestBody List<TUSERAHIAgency> l_list){
        agencyService.dealReceiveListAHIAgencyData(l_list);
        return Result.ok();
    }
    /**
     *
     */
    @RequestMapping(value = "/ChengduTUSERAHIUserEX", method = RequestMethod.POST)
    public Result receiveUser(@RequestBody UserDataToSiChuanResponse l_list){
        agencyService.dealReceiveListUser(l_list);
        return Result.ok();
    }

}
